package me.sdau.spider.manager.modules.system.service.impl;

import me.sdau.spider.manager.modules.system.entity.User;
import me.sdau.spider.manager.modules.system.mapper.UserMapper;
import me.sdau.spider.manager.modules.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zj
 * @date 2018/4/8 19:08
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User getUserById(long id) {
        return userMapper.getOne(id);
    }

    @Override
    public User getUserByUsername(String username) {
        return userMapper.getUserByUsername(username);
    }

    @Override
    public int insertUser(User user) {
        return userMapper.insert(user);
    }

    @Override
    public int insertUserRole(User user) {
        return userMapper.insertUserRole(user);
    }
}
